<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex Withdrawals_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center justify-between flex-sub Withdrawals_fd0_0'>
					<view class='flex align-center Withdrawals_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<text class='fu-iconfont2  Withdrawals_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex align-center'>
						<text class='Withdrawals_fd0_0_c1_c0'>提现</text>
					</view>
					<view class='flex align-center justify-end Withdrawals_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/wode/myMoney/withdrawDetails`">
						<text class='Withdrawals_fd0_0_c2_c0'>明细</text>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="flex flex-direction align-stretch benben-flex-layout Withdrawals_flex_1">
				<view class='flex flex-direction align-stretch Withdrawals_fd1_0'>
					<text class='Withdrawals_fd1_0_c0'>输入提现金额</text>
					<view class='flex flex-wrap align-center justify-between Withdrawals_fd1_0_c1'>
						<view class='flex flex-wrap align-center flex-sub Withdrawals_fd1_0_c1_c0'>
							<text class='Withdrawals_fd1_0_c1_c0_c0'>￥</text>
							<input class='flex-sub Withdrawals_fd1_0_c1_c0_c1' type="text"
								:placeholder="`账户余额${dataMoney.user_money}`" confirm-type="done" :maxlength="-1"
								placeholder-style="color:#999;font-size:32rpx" v-model="cash_fee" />
						</view>
						<text class='Withdrawals_fd1_0_c1_c1' @tap.stop="allmoneyFunc()">全部</text>
					</view>
					<view class='flex flex-wrap align-center Withdrawals_fd1_0_c2'>
						<text
							class='Withdrawals_fd1_0_c2_c0'>起提金额：{{dataMoney.withdraw_min_money}}元，提现收取{{dataMoney.withdraw_service_fee_ratio}}的手续费</text>
						<text class='fu-iconfont2  Withdrawals_fd1_0_c2_c1'
							@tap.stop="popupShow1673862116532=true">&#xE600;</text>
					</view>
				</view>
				<view class='flex flex-direction align-stretch Withdrawals_fd1_1'>
					<text class='Withdrawals_fd1_1_c0'>请选择提现方式</text>
					<template v-for='(item,key0) in dataType'>
						<view class='flex flex-wrap align-center Withdrawals_fd1_1_c1'
							@tap.stop="getselectmessageFunc(item)" :key='key0'>
							<image class='Withdrawals_fd1_1_c1_c0' mode="aspectFit" :src='item.image'></image>
							<text class='Withdrawals_fd1_1_c1_c1'>{{item.name}}</text>
							<image class='Withdrawals_fd1_1_c1_c2' mode="aspectFit" :src='STATIC_URL+"33.png"'
								v-if=" item.pay_type==embody_id"></image>
							<image class='Withdrawals_fd1_1_c1_c2' mode="aspectFit" :src='STATIC_URL+"83.png"'
								v-if=" item.pay_type!=embody_id"></image>
						</view>
					</template>

				</view>
				<view class='flex flex-wrap align-center justify-center Withdrawals_fd1_2'>
					<button class='Withdrawals_fd1_2_c0' @tap.stop="queryMessageFunc()">提现</button>
				</view>
			</view>

			<benben-popup v-model="popupShow1673862116532" :mask="true" :mask-close-able="true" mode='center'>
				<!---富文本弹窗flex布局开始-->
				<view class="flex flex-direction flex-wrap align-center benben-flex-layout">
					<view class='flex flex-direction flex-wrap align-center Withdrawals_fd2_0'>
						<text class='Withdrawals_fd2_0_c0'>提现规则</text>

						<scroll-view class='Withdrawals_fd2_0_c1' :scroll-y='true'>
							<view class='flex benben-scroll flex align-center'>
								<u-parse :html="dataMoney.withdraw_rule"></u-parse>
							</view>
						</scroll-view>

					</view>
					<image class='Withdrawals_fd2_1' mode="aspectFit" :src='STATIC_URL+"66.png"'
						@tap.stop="popupShow1673862116532=false"></image>
				</view>

				<!---富文本弹窗flex布局结束-->

			</benben-popup>
			<benben-popup v-model="popupShow1686628262181" :mask="true" :mask-close-able="true" mode='center'>
				<!---未绑定微信弹窗flex布局开始-->
				<view class="flex flex-direction flex-wrap align-center Withdrawals_flex_3">
					<text class='Withdrawals_fd3_0'>还未绑定微信,是否前往绑定?</text>
					<view class='flex flex-wrap align-center'>
						<button class='Withdrawals_fd3_1_c0' @tap.stop="popupShow1686628262181=false">取消</button>
						<button class='Withdrawals_fd3_1_c1' @tap.stop="gowxFunc()">确定</button>
					</view>
				</view>

				<!---未绑定微信弹窗flex布局结束-->

			</benben-popup>
			<benben-popup v-model="popupShow1686628821361" :mask="true" :mask-close-able="true" mode='center'>
				<!---未绑定支付宝弹窗flex布局开始-->
				<view class="flex flex-direction flex-wrap align-center Withdrawals_flex_4">
					<text class='Withdrawals_fd4_0'>还未绑定支付宝,是否前往绑定?</text>
					<view class='flex flex-wrap align-center'>
						<button class='Withdrawals_fd4_1_c0' @tap.stop="popupShow1686628821361=false">取消</button>
						<button class='Withdrawals_fd4_1_c1' @tap.stop="goalipayFunc()">确定</button>
					</view>
				</view>

				<!---未绑定支付宝弹窗flex布局结束-->

			</benben-popup>
			<benben-popup v-model="popupShow1686629150177" :mask="true" :mask-close-able="true" mode='center'>
				<!---未绑定银行卡弹窗flex布局开始-->
				<view class="flex flex-direction flex-wrap align-center Withdrawals_flex_5">
					<text class='Withdrawals_fd5_0'>还未绑定银行卡,是否前往绑定?</text>
					<view class='flex flex-wrap align-center'>
						<button class='Withdrawals_fd5_1_c0' @tap.stop="popupShow1686629150177=false">取消</button>
						<button class='Withdrawals_fd5_1_c1' @tap.stop="gobankFunc()">确定</button>
					</view>
				</view>

				<!---未绑定银行卡弹窗flex布局结束-->

			</benben-popup>


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"popupShow1686629150177": false,
				"popupShow1686628821361": false,
				"popupShow1686628262181": false,
				"popupShow1673862116532": false,
				"embody_id": "2",
				"payID": "wxpay",
				"dataEssay": {
					"aid": "",
					"name": "",
					"thumb_img": "",
					"content": "",
					"introduce": ""
				},
				"cash_fee": "",
				"dataMessage": [],
				"dataType": [{
						pay_type: '2',
						name: '支付宝',
						image: '/static/images/34.png'
					},
					{
						pay_type: '1',
						name: '微信',
						image: '/static/images/27.png'
					}
				],
				"dataMoney": {
					"aid": "",
					"user_money": "",
					"freeze_money": "",
					"total_consumption_money": "",
					"total_consumption_virtual_money": "",
					"total_revenue_money": "",
					"total_revenue_virtual_money": "",
					"empirical": "",
					"score": "",
					"count_score": "",
					"commission": "",
					"total_order_commission_money": "",
					"withdrawal_money": "",
					"share_money": "",
					"discounts_money": "",
					"create_time": "",
					"user_id": "",
					"withdraw_rule": "",
				},
				"is_bind": "",
				"method_fee": "",
				"method_max": "",
				"method_min": "",
				"rules": {},
				"method_name": "微信",
				"isbind_wx": 0,
				"isbind_ali": 0,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getWenzhangFunc();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getMoneyFunc();
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//点击全部
			allmoneyFunc() {
				this.cash_fee = this.dataMoney.user_money;
			},
			getselectmessageFunc(item) {
				// console.log(item);
				this.embody_id = item.pay_type;
				this.rules = item;
			},
			
			//提现
			queryMessageFunc() {
				if (!validate(this.cash_fee, 'require')) {
					this.$message.info('请输入提现金额');
					return false;
				}
				if (Number(this.cash_fee) > Number(this.dataMoney.user_money)) {
					this.cash_fee = '';
					this.$message.info('余额不足，请重新输入金额');
					return
				}
				if (Number(this.cash_fee) < Number(this.dataMoney.withdraw_min_money)) {
					this.$message.info('提现金额小于起提金额');
					return;
				}
				this.$api.post(global.apiUrls.post6600d617b4f93, {
					account_type: this.embody_id,
					cash_fee: this.cash_fee
				}).then(res => {
					if (res.data.code == 1) {
						this.$message.info(res.data.msg);
						setTimeout(() => {
							uni.redirectTo({
								url: '/pages/wode/myMoney/application?type=' + this.embody_id + '&money=' + this.cash_fee
							})
						}, 800)
					} else if (res.data.code == 0) {
						this.$message.info(res.data.msg);
					} else if (res.data.code == -2) {
						if (this.embody_id == '1') {
							this.popupShow1686628262181 = true;
						} else if (this.embody_id == '2') {
							this.popupShow1686628821361 = true;
						}
					}
				})
			},
			//跳转绑定微信
			gowxFunc() {
				this.popupShow1686628262181 = false;
				uni.navigateTo({
					url: '/pages/wode/myMoney/bindWechat'
				})
			},
			//跳转支付宝
			goalipayFunc() {
				this.popupShow1686628821361 = false;
				uni.navigateTo({
					url: '/pages/wode/myMoney/bindAlipay'
				})
			},
			//跳转银行卡
			gobankFunc() {
				this.popupShow1686629150177 = false;
				this.$urouter.navigateTo(`/pages/wd/bindBankCard/bindBankCard?type=0`);
			},

			//获取可提现金额
			async getMoneyFunc() {
				//请求方法
				//数据验证

				let datadataMoney = await this.$api.get(global.apiUrls.post6600d6044b238, {

				});

				if (datadataMoney.data.code != 1) {
					this.$message.info(datadataMoney.data.msg);
					return
				}
				let infodataMoney = datadataMoney.data;
				this.dataMoney = infodataMoney.data;
				console.log(this.dataMoney);
			},
			//系统文章--获取系统单页内容
			async getWenzhangFunc() {
				//请求方法
				//数据验证

				let datadataEssay = await this.$api.post(global.apiUrls.post656f313a73452, {
					id: 22
				});

				if (datadataEssay.data.code != 1) {
					this.$message.info(datadataEssay.data.msg);
					return
				}
				let infodataEssay = datadataEssay.data;
				this.dataEssay = infodataEssay.data

			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.Withdrawals_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.Withdrawals_fd0_0_c2_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.Withdrawals_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.Withdrawals_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.Withdrawals_fd0_0_c0 {
		width: 180rpx;
	}

	.Withdrawals_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.Withdrawals_flex_1 {
		padding: 0rpx 0rpx 150rpx 0rpx;
	}

	.Withdrawals_fd1_2_c0 {
		background: #3083FF;
		font-size: 32rpx;
		color: #fff;
		width: 686rpx;
		height: 80rpx;
		line-height: 80rpx;
		font-weight: 500;
		border-radius: 50rpx;
	}

	.Withdrawals_fd1_2 {
		width: 750rpx;
		position: fixed;
		left: 0rpx;
		bottom: calc(40rpx + var(--window-bottom));
	}

	.Withdrawals_fd1_1_c1_c2 {
		width: 36rpx;
		height: 36rpx;
		margin: 0rpx 0rpx 0rpx auto;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
	}

	.Withdrawals_fd1_1_c1_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
	}

	.Withdrawals_fd1_1_c1_c0 {
		width: 52rpx;
		height: 52rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.Withdrawals_fd1_1_c1 {
		border-bottom: 1px solid #eee;
		padding: 28rpx 0rpx 28rpx 0rpx;
	}

	.Withdrawals_fd1_1_c0 {
		font-size: 32rpx;
		font-weight: 700;
		color: #333;
		margin: 0rpx 0rpx 8rpx 0rpx;
	}

	.Withdrawals_fd1_1 {
		background: #fff;
		padding: 32rpx 32rpx 0rpx 32rpx;
		background-size: 100% auto !important;
		margin: 20rpx 0rpx 0rpx 0rpx;
	}

	.Withdrawals_fd1_0_c2_c1 {
		margin: 0rpx 0rpx 0rpx 16rpx;
		color: rgba(191, 191, 191, 1);
		font-size: 26rpx;
	}

	.Withdrawals_fd1_0_c2_c0 {
		line-height: 53rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
	}

	.Withdrawals_fd1_0_c2 {
		margin: 24rpx 0rpx 0rpx 0rpx;
	}

	.Withdrawals_fd1_0_c1_c1 {
		font-size: 32rpx;
		font-weight: 500;
		color: #3083FF;
	}

	.Withdrawals_fd1_0_c1_c0_c1 {
		padding: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
	}

	.Withdrawals_fd1_0_c1_c0_c0 {
		font-size: 56rpx;
		font-weight: 400;
		color: #333333;
	}

	.Withdrawals_fd1_0_c1_c0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.Withdrawals_fd1_0_c1 {
		border-bottom: 1px solid #eee;
	}

	.Withdrawals_fd1_0_c0 {
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
	}

	.Withdrawals_fd1_0 {
		background: #fff;
		padding: 32rpx;
		background-size: 100% auto !important;
	}

	.Withdrawals_fd2_1 {
		width: 56rpx;
		height: 56rpx;
		border-radius: 28rpx 28rpx 28rpx 28rpx;
	}

	::v-deep .Withdrawals_fd2_0_c1_c0 {
		width: 480rpx;
	}

	.Withdrawals_fd2_0_c1 {
		touch-action: none;
		height: 330rpx;
		width: 480rpx;
	}

	.Withdrawals_fd2_0_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: rgba(51, 51, 51, 1);
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.Withdrawals_fd2_0 {
		background: #fff;
		width: 560rpx;
		background-size: 100% auto !important;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		padding: 28rpx 32rpx 45rpx 32rpx;
		margin: 0rpx 0rpx 40rpx 0rpx;
	}

	.Withdrawals_flex_3 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.Withdrawals_fd3_1_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: var(--benbenbgColor1);
		line-height: 94rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: #3090FF;
		padding: 0rpx 104rpx 0rpx 101rpx;
		font-weight: 500;
	}

	.Withdrawals_fd3_1_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		line-height: 94rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		padding: 0rpx 102rpx 0rpx 103rpx;
		font-weight: 400;
	}

	.Withdrawals_fd3_0 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		margin: 91rpx 0rpx 88rpx 0rpx;
	}

	.Withdrawals_flex_4 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.Withdrawals_fd4_1_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		line-height: 94rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: #3090FF;
		padding: 0rpx 104rpx 0rpx 101rpx;
		font-weight: 500;
	}

	.Withdrawals_fd4_1_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		line-height: 94rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		padding: 0rpx 102rpx 0rpx 103rpx;
		font-weight: 400;
	}

	.Withdrawals_fd4_0 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		margin: 91rpx 0rpx 88rpx 0rpx;
	}

	.Withdrawals_flex_5 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.Withdrawals_fd5_1_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		line-height: 94rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor5);
		padding: 0rpx 104rpx 0rpx 101rpx;
		font-weight: 500;
	}

	.Withdrawals_fd5_1_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		line-height: 94rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		padding: 0rpx 102rpx 0rpx 103rpx;
		font-weight: 400;
	}

	.Withdrawals_fd5_0 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		margin: 91rpx 0rpx 88rpx 0rpx;
	}

	.offerPay_fd3_1_c1_c2 {
		width: 37rpx;
		height: 37rpx;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.offerPay_fd3_1_c0_c2 {
		width: 36rpx;
		height: 36rpx;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.offerPay_fd3_1_c0_c1 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
		line-height: 45rpx;
	}

	.offerPay_fd3_1_c0_c0 {
		width: 56rpx;
		height: 56rpx;
		border-radius: 26rpx 26rpx 26rpx 26rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.offerPay_fd3_1_c0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.offerPay_fd3_0 {
		border-bottom: 1px solid #eee;
		font-size: 28rpx;
		font-weight: 400;
		color: #666666;
		padding: 32rpx 0rpx 32rpx 0rpx;
		line-height: 40rpx;
	}
</style>